//
//  KoiBackButton.swift
//  KoiAccounting
//
//  Created by 纪洪文 on 30.03.25.
//

import SwiftUI

struct KoiBackButton: View {

    @Environment(\.presentationMode) var presentationMode
        
    var onBackClick:(()->Void)? = nil
    
    var body: some View {
        Button(action: {
            if (onBackClick != nil) {
                onBackClick?()
            } else {
                presentationMode.wrappedValue.dismiss()
            }
        }) {
            Image(systemName: "chevron.backward")
                .renderingMode(.template)
                .foregroundColor(Color.koiColorTitle)
                .padding(.horizontal,14)
        }
    }
}

#Preview {
    KoiBackButton()
}
